package com.woniuxy.controller;

import com.woniuxy.pojo.ShippingCompany;
import com.woniuxy.service.ShippingCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shippingCompany")
public class ShippingCompanyController {
    @Autowired
    private ShippingCompanyService shippingCompanyService;

   /* @GetMapping("/getAllExpressCompanies")
    public ResponseEntity<?> getAllExpressCompanies(){
        List<String> name = shippingCompanyService.getAllExpressCompanies();
        return ResponseEntity.ok(name);
    }*/

    @GetMapping("/getAllExpressCompanies")
    public ResponseEntity<?> getAllExpressCompanies(){
        List<ShippingCompany> name = shippingCompanyService.getAllExpressCompanies();
        return ResponseEntity.ok(name);
    }
}
